# -*- coding: utf-8 -*-
# Python 2.7
# Pattern based natural language processing tools for Estonian.
# Copyright (C) 2013 University of Tartu
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os.path
PYPATNLP_PATH = os.path.dirname(__file__)
PATNLP_PATH   = os.path.normpath(PYPATNLP_PATH + '/..')
BIN_PATH      = os.path.join(PATNLP_PATH, 'bin')
DATA_PATH     = os.path.join(PATNLP_PATH, 'data')

import cPickle

def load_obj(fnm):
    f = open(fnm, 'rb')
    o = cPickle.load(f)
    f.close()
    return o

def save_obj(o, fnm):
    f = open(fnm, 'wb')
    cPickle.dump(o, f)
    f.close()
